import React from 'react';
import { observer } from 'mobx-react-lite';
import loginStore from '@/store/login';
import './index.less';

const MobileItem = observer(() => {
    return (
        <div className='home-form-item'>
            <span>手机号：</span>
            <input
                type='text'
                maxLength={13}
                placeholder='请输入手机号'
                value={loginStore.mobile}
                onChange={(e) => {
                    let { value } = e.target;
                    value = value.replace(/\D/g, '');
                    loginStore.setMobile(value);
                }}
            />
        </div>
    );
});

export default MobileItem;
